//
// Created by wze-zero on 2024/9/4 004.
//
#include <iostream>

using namespace std;

int main() {
    int num;
    int n[] = {2, 3, 7};
    bool check = false;
    cin >> num;
    for (int i = 0; i < sizeof n / sizeof n[0]; ++i) {
        if (num % n[i] == 0) {
            cout << n[i] << " ";
            check = true;
        }
    }
    if (!check) {
        cout << 'n';
    }
    return 0;
}